graceful reload

graceful reload

am 03.06.2010 08:23:36 von Vasiliy G Tolstov

Hello.

I'm use linux and postgresql under xen vps. Vps supports memory balloon
(i need to increase memory some time). Can postgresql server has ability
to graceful reload itself after it configuration files changed?
Thank You.

--
Vasiliy G Tolstov
Selfip.Ru


--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: graceful reload

am 03.06.2010 09:45:28 von Anh Ky Huynh

On Thu, 03 Jun 2010 10:23:36 +0400
Vasiliy G Tolstov wrote:

> Hello.
>
> I'm use linux and postgresql under xen vps. Vps supports memory
> balloon (i need to increase memory some time). Can postgresql
> server has ability to graceful reload itself after it configuration
> files changed? Thank You.

I'm afraid *NOT*. You can write a script / cronjob for this task. The script will check postgresql periodically and will restart posgresql daemon in case the configuration was changed. You can use `stat` command (try `stat --help`) to get the right information about file's modifcation. You should *check* if your configuration is valid before restart the daemon as any wrong modification can cause your server to stop :)

I know there's a tool that will do some tasks whenever a(ny) file in the system has been modified. But I can't remember the name of that tool.

Regards,

--
Anh Ky Huynh

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: graceful reload

am 03.06.2010 09:48:23 von Vasiliy G Tolstov

В Чтв, 03/06/2010 в 14:45 +0700, Anh Ky Huynh =D0=
¿Ð¸ÑˆÐµÑ=82:
> On Thu, 03 Jun 2010 10:23:36 +0400
> Vasiliy G Tolstov wrote:
>=20
> > Hello.
> >=20
> > I'm use linux and postgresql under xen vps. Vps supports memory
> > balloon (i need to increase memory some time). Can postgresql
> > server has ability to graceful reload itself after it configuration
> > files changed? Thank You.
>=20
> I'm afraid *NOT*. You can write a script / cronjob for this task. The s=
cript will check postgresql periodically and will restart posgresql daemo=
n in case the configuration was changed. You can use `stat` command (try =
`stat --help`) to get the right information about file's modifcation. You=
should *check* if your configuration is valid before restart the daemon =
as any wrong modification can cause your server to stop :)
>=20
> I know there's a tool that will do some tasks whenever a(ny) file in th=
e system has been modified. But I can't remember the name of that tool.
>=20
> Regards,
>=20

Sorry for incorrect question. I mean: does postgresql can be reloaded
without breaking current connections?=20
For example:
I need to increate some values in postgresql conf file and want to this
valies applied on running server, can i do this without full restart?

--=20
Vasiliy G Tolstov
Selfip.Ru


--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: graceful reload

am 03.06.2010 09:54:52 von Shoaib Mir

--000feaeb3f2681efb904881b851a
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Jun 3, 2010 at 5:48 PM, Vasiliy G Tolstov wrote:

> Sorry for incorrect question. I mean: does postgresql can be reloaded
> without breaking current connections?
> For example:
> I need to increate some values in postgresql conf file and want to this
> valies applied on running server, can i do this without full restart?
>
>
Which settings you want to change? as there are some which can be done with
just a database reload but some of them cant be done without doing a
database restart (like some memory related settings)

--
Shoaib Mir
http://shoaibmir.wordpress.com/

--000feaeb3f2681efb904881b851a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 3, 2010 at 5:48 PM, Vasiliy G Tolstov < href=3D"mailto:v.tolstov@selfip.ru">v.tolstov@selfip.ru> wrot=
e:

"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Sorry for incorrect question. I mean: does postgresql can=
be reloaded

without breaking current connections?

For example:

I need to increate some values in postgresql conf file and want to this

valies applied on running server, can i do this without full restart?
r>

Which settings you want to change? as th=
ere are some which can be done with just a database reload but some of them=
cant be done without doing a database restart (like some memory related se=
ttings)


--
Shoaib Mir
ress.com/">http://shoaibmir.wordpress.com/


--000feaeb3f2681efb904881b851a--

Re: graceful reload

am 03.06.2010 10:01:14 von Vasiliy G Tolstov

В Чтв, 03/06/2010 в 17:54 +1000, Shoaib Mir п=
ишет:
> On Thu, Jun 3, 2010 at 5:48 PM, Vasiliy G Tolstov
> wrote:
> Sorry for incorrect question. I mean: does postgresql can be
> reloaded
> without breaking current connections?
> For example:
> I need to increate some values in postgresql conf file and
> want to this
> valies applied on running server, can i do this without full
> restart?
> =20
>=20
>=20
> Which settings you want to change? as there are some which can be done
> with just a database reload but some of them cant be done without
> doing a database restart (like some memory related settings)
>=20

Memory related:
max_connections
shared_buffers
temp_buffers
max_prepared_transactions
work_mem
maintenance_work_mem
max_stack_depth
max_files_per_process
wal_buffers

In config file some in of this settings exists comment line like
"changes require restart". This is mean exactly restart or reload can do
this?


--=20
Vasiliy G Tolstov
Selfip.Ru


--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: graceful reload

am 03.06.2010 11:15:46 von Shoaib Mir

--00c09f93dabbe2bd0904881ca623
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Jun 3, 2010 at 6:01 PM, Vasiliy G Tolstov wrote:

>
> Memory related:
> max_connections
> shared_buffers
> temp_buffers
> max_prepared_transactions
> work_mem
> maintenance_work_mem
> max_stack_depth
> max_files_per_process
> wal_buffers
>
> In config file some in of this settings exists comment line like
> "changes require restart". This is mean exactly restart or reload can do
> this?
>
>
>
For these you really need a database restart as reload will not help.

--
Shoaib Mir
http://shoaibmir.wordpress.com/

--00c09f93dabbe2bd0904881ca623
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 3, 2010 at 6:01 PM, Vasiliy G Tolstov < href=3D"mailto:v.tolstov@selfip.ru">v.tolstov@selfip.ru> wrot=
e:

gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">



Memory related:

max_connections

shared_buffers

temp_buffers

max_prepared_transactions

work_mem

maintenance_work_mem

max_stack_depth

max_files_per_process

wal_buffers



In config file some in of this settings exists comment line like

"changes require restart". This is mean exactly restart or reload=
can do

this?




For=
these you really need a database restart as reload will not help.=A0
=

--
Shoaib Mir
=
http://shoaibmir.wordpress.com/




--00c09f93dabbe2bd0904881ca623--

Re: graceful reload

am 03.06.2010 19:07:03 von Greg Smith

Vasiliy G Tolstov wrote:
> In config file some in of this settings exists comment line like
> "changes require restart". This is mean exactly restart or reload can do
> this?
>

Run this:

$ psql -c "select name,context from pg_settings"

This will sort out which settings are in which category definitively,
rather than relying on the sometimes ambiguous comments in the file.
Settings that say "postmaster" require a full database restart. Ones
labeled "sighup" can be changed in the postgresql.conf and then the
server signaled to use them, most easily with:

pg_ctl reload
-OR-
psql -c "select pg_reload_conf()"

Ones labeled "user" you can actually change for any user at any time
during their session. Modifying the defaults and then executing the
sighup procedure will make those new defaults active, but not for any
clients that already have open connections.

I recommend using SHOW or looking at pg_settings after making a change
and reloading the server config to confirm it took.

--
Greg Smith 2ndQuadrant US Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com www.2ndQuadrant.us


--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: graceful reload

am 04.06.2010 08:07:12 von Vasiliy G Tolstov

В Чтв, 03/06/2010 в 13:07 -0400, Greg Smith п=
ишет:
> Vasiliy G Tolstov wrote:
> > In config file some in of this settings exists comment line like
> > "changes require restart". This is mean exactly restart or reload can=
do
> > this?
> > =20
>=20
> Run this:
>=20
> $ psql -c "select name,context from pg_settings"
>=20
> This will sort out which settings are in which category definitively,=20
> rather than relying on the sometimes ambiguous comments in the file. =20
> Settings that say "postmaster" require a full database restart. Ones=20
> labeled "sighup" can be changed in the postgresql.conf and then the=20
> server signaled to use them, most easily with:
>=20
> pg_ctl reload
> -OR-
> psql -c "select pg_reload_conf()"
>=20
> Ones labeled "user" you can actually change for any user at any time=20
> during their session. Modifying the defaults and then executing the=20
> sighup procedure will make those new defaults active, but not for any=20
> clients that already have open connections.
>=20
> I recommend using SHOW or looking at pg_settings after making a change=20
> and reloading the server config to confirm it took.
>=20

Ok, Thank You very much! This is really helpful.

--=20
Vasiliy G Tolstov
Selfip.Ru


--=20
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin